package com.itlong.cloud.operate.service;

import com.itlong.cloud.POJO.DTO.operate.OperateDeviceManageGetPageDTO;
import com.itlong.cloud.POJO.PO.OperateUserInfoPO;
import com.itlong.cloud.POJO.PO.OperationSpecialLogPO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceDetailsVO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceManageInfoAllVO;
import com.itlong.cloud.POJO.VO.operate.OperatePassPercentVO;
import com.itlong.cloud.utils.page.Page;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      运营-项目管理-设备管理服务接口。
 * <desc/>
 *
 * @createDate 2019/01/18.
 */
public interface IOperateDeviceManageService {

    /**
     * <desc>
     *      分页获取设备信息。
     * <desc/>
     *
     * @param  dto 参数请求对象
     * @return
     * @author Qiang.S
     * @createDate 2019/01/18
     */
    OperateDeviceManageInfoAllVO getDeviceByPage(OperateDeviceManageGetPageDTO dto) throws Exception;


    /**
     * <desc>
     *      获取每个设备所占比例及统计在线与离线设备
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2019/10/28
     */
    OperateDeviceManageInfoAllVO getOperateDeviceInfo() throws Exception;

    /**
     * <desc>
     *      修改设备的状态 删除、恢复
     * </desc>
     *
     * @param dto 参数DTO
     * @return
     * @author Juguang.S
     * @createDate 2020/12/02
     */
    void modifyDeviceStatus(OperateDeviceManageGetPageDTO dto) throws Exception;
    /**
     * <desc>
     * 删除运行日志
     * </desc>
     *
     * @param runLogId 运行日志逻辑ID
     * @return Object
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    Integer delRunLog(String runLogId);

    /**
     * <desc>
     * 运行日志列表
     * </desc>
     *
     * @param deviceUnique 设备ID
     * @return Object
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    Map<String,Object> getRunLogInfoPage(String deviceUnique, int pageSize, int currentPage, String orderRule);

    /**
     * <desc>
     * 设备重启业务
     * </desc>
     *
     * @param deviceUnique 设备ID
     * @return
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    Integer restartDevice(String deviceUnique, String deviceType) throws Exception;

    /**
     * <desc>
     *      获取设备业务
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/25 15:36
     */
    Integer getDeviceLog(String deviceUnique, String deviceId, String deviceType) throws Exception;

    /**
     * <desc>
     *      获取详情
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/25 15:36
     */
    OperateDeviceDetailsVO getDeviceDetails(String deviceUnique);

    /**
     * <desc>
     * 获取分页设备在线状态变更日志
     * </desc>
     *
     * @param deviceUnique
     * @param pageSize
     * @param currentPage
     * @return
     * @author caoshuai
     * @createDate 2020/11/25 9:23
     */
    Page getDeviceOnlineStatusAlterLogPage(String deviceUnique, int pageSize, int currentPage);

    /**
     * <desc>
     * 保存操作日志信息
     * </desc>
     *
     * @param operationSpecialLog
     * @return
     * @author caoshuai
     * @createDate 2020/12/14 11:30
     */
    Integer saveOperationSpecialLog(OperationSpecialLogPO operationSpecialLog) throws Exception;

    /**
     * <desc>
     * 获取用户信息
     * </desc>
     *
     * @param myUserName
     * @return
     * @author caoshuai
     * @createDate 2020/12/14 11:30
     */
    OperateUserInfoPO getOperateUserPO(String myUserName);

    /**
     * <desc>
     *      获取设备的开门方式占比
     * </desc>
     *
     * @param deviceUnique 设备唯一码
     * @return
     * @Author Zhu.yj
     * @createDate  2020/12/23
     */
    List<OperatePassPercentVO> getOpenPercent(String deviceUnique) throws Exception;

    /**
     *<desc>
     * 查询云设备的推送指令
     *</desc>
     *
     * @Author  chengshican
     * @Date   2020-12-29 13:51
     * @Param  tableName 数据库表名 ， sn 设备sn， deviceUnique 设备唯一标识
     * @Return  commandStatus 命令处理状态,  updateTime 更新时间,  createTime 创建时间
     * @Exception
     *
     */
    Map<String, Object>  getPushCloudChangeLog(Map<String, Object> params);
    /**
     * <desc>
     *      定时从设备获取日志
     * </desc>
     *
     *
     * @author maju
     * @createDate 2021/4/27
     */
    void getDeviceLogByTask();
    /***
     * <desc>
     *      定时下载设备日志
     * </desc>
     *
     *
     * @author maju
     * @createDate 2021/4/27
     */
    void downloadDeviceLogByTask();

}
